package com.ywger.integration.log;

import static com.ywger.integration.constants.log.LogFormat.BIZ_ONE_KEY_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.BIZ_TOW_KEY_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.TASK_BIZ_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.TASK_END_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.TASK_START_FORMAT;
import org.slf4j.Logger;

/**
 * @author chenmeng
 * @date 2021-07-24 19:09
 * @desc
 */
public class BizLogger extends CommonLogger{

    public static void info(Logger log, String firstKey, String customFormatMsg, Object... arguments){
        String format = String.format(BIZ_ONE_KEY_FORMAT,customFormatMsg);
        log.info(format,expand(firstKey,arguments));
    }

    public static void infoTwoKey(Logger log, String firstKey,String secondKey, String customFormatMsg, Object... arguments){
        String format = String.format(BIZ_TOW_KEY_FORMAT,customFormatMsg);
        log.info(format,expand(firstKey,secondKey,arguments));
    }

    public static void warn(Logger log, String firstKey, String customFormatMsg, Object... arguments){
        String format = String.format(BIZ_ONE_KEY_FORMAT,customFormatMsg);
        log.warn(format,expand(firstKey,arguments));
    }

    public static void warn(Logger log, String firstKey,String secondKey, String customFormatMsg, Object... arguments){
        String format = String.format(BIZ_TOW_KEY_FORMAT,customFormatMsg);
        log.warn(format,expand(firstKey,secondKey,arguments));
    }
}
